﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Lir.Pager.Entity;
using QuickORM.BLL;

public partial class Manage_Message : Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Show();
        }
    }

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        Show();
    }

    protected void Show()
    {
        Bind(rpt1, "通知公告");
        Bind(rpt2, "资讯");
        Bind(rpt3, "文件下载");
        Bind(rpt4, "学术园地");
    }

    protected void Bind(Repeater rpt, string typeName)
    {
        var pager = new PagerInfo();
        pager.CurrenetPageIndex = 1;
        pager.PageSize = 10;
        rpt.DataSource = BLLFactory<T_ManagerInfoManager>.Instance.FindWithPager(string.Format("M_Type='{0}'", typeName), pager, "M_Time", true);
        // rpt.DataSource = BLLFactory<T_ManagerInfoManager>.Instance.Find(string.Format("M_Type='{0}'",typeName), "order by M_Time desc");
        rpt.DataBind();
    }
}